/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pooproj.gui;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import pooproj.erro.ConexaoException;
import pooproj.util.GerenciadorConexao;
import pooproj.util.GerenciadorConexaoImpl;

/**
 *
 * @author Daniella
 */
public class pooproj extends javax.swing.JFrame {

    /**
     * Creates new form pooproj
     */
    public pooproj() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuClienteCadastrar = new javax.swing.JMenuItem();
        menuClienteConsultar = new javax.swing.JMenuItem();
        menuClienteAlterar = new javax.swing.JMenuItem();
        menuClienteExcluir = new javax.swing.JMenuItem();
        menuClienteListar = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        menuLocCadastrar = new javax.swing.JMenuItem();
        menuLocConsultar = new javax.swing.JMenuItem();
        menuLocAlterar = new javax.swing.JMenuItem();
        menuLocExcluir = new javax.swing.JMenuItem();
        menuLocListar = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        menuFilmeCadastrar = new javax.swing.JMenuItem();
        menuFilmeConsultar = new javax.swing.JMenuItem();
        menuFilmeAlterar = new javax.swing.JMenuItem();
        menuFilmeExcluir = new javax.swing.JMenuItem();
        menuFilmeListar = new javax.swing.JMenuItem();
        menuCateg = new javax.swing.JMenu();
        menuCategCadastrar = new javax.swing.JMenuItem();
        menuCategConsultar = new javax.swing.JMenuItem();
        menuCategAlterar = new javax.swing.JMenuItem();
        menuCategExcluir = new javax.swing.JMenuItem();
        menuCategListar = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenu4.setText("jMenu4");

        jMenuItem4.setText("jMenuItem4");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton1.setText("Conectar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jMenu1.setText("Cliente");

        menuClienteCadastrar.setText("Cadastrar");
        menuClienteCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuClienteCadastrarActionPerformed(evt);
            }
        });
        jMenu1.add(menuClienteCadastrar);

        menuClienteConsultar.setText("Consultar");
        menuClienteConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuClienteConsultarActionPerformed(evt);
            }
        });
        jMenu1.add(menuClienteConsultar);

        menuClienteAlterar.setText("Alterar");
        menuClienteAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuClienteAlterarActionPerformed(evt);
            }
        });
        jMenu1.add(menuClienteAlterar);

        menuClienteExcluir.setText("Excluir");
        menuClienteExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuClienteExcluirActionPerformed(evt);
            }
        });
        jMenu1.add(menuClienteExcluir);

        menuClienteListar.setText("Listar");
        menuClienteListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuClienteListarActionPerformed(evt);
            }
        });
        jMenu1.add(menuClienteListar);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Locação");

        menuLocCadastrar.setText("Cadastrar");
        menuLocCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLocCadastrarActionPerformed(evt);
            }
        });
        jMenu2.add(menuLocCadastrar);

        menuLocConsultar.setText("Consultar");
        menuLocConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLocConsultarActionPerformed(evt);
            }
        });
        jMenu2.add(menuLocConsultar);

        menuLocAlterar.setText("Alterar");
        menuLocAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLocAlterarActionPerformed(evt);
            }
        });
        jMenu2.add(menuLocAlterar);

        menuLocExcluir.setText("Excluir");
        menuLocExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLocExcluirActionPerformed(evt);
            }
        });
        jMenu2.add(menuLocExcluir);

        menuLocListar.setText("Listar");
        menuLocListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLocListarActionPerformed(evt);
            }
        });
        jMenu2.add(menuLocListar);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Filme");

        menuFilmeCadastrar.setText("Cadastrar");
        menuFilmeCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFilmeCadastrarActionPerformed(evt);
            }
        });
        jMenu3.add(menuFilmeCadastrar);

        menuFilmeConsultar.setText("Consultar");
        menuFilmeConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFilmeConsultarActionPerformed(evt);
            }
        });
        jMenu3.add(menuFilmeConsultar);

        menuFilmeAlterar.setText("Alterar");
        menuFilmeAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFilmeAlterarActionPerformed(evt);
            }
        });
        jMenu3.add(menuFilmeAlterar);

        menuFilmeExcluir.setText("Excluir");
        menuFilmeExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFilmeExcluirActionPerformed(evt);
            }
        });
        jMenu3.add(menuFilmeExcluir);

        menuFilmeListar.setText("Listar");
        menuFilmeListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFilmeListarActionPerformed(evt);
            }
        });
        jMenu3.add(menuFilmeListar);

        jMenuBar1.add(jMenu3);

        menuCateg.setText("Categoria");

        menuCategCadastrar.setText("Cadastrar");
        menuCategCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCategCadastrarActionPerformed(evt);
            }
        });
        menuCateg.add(menuCategCadastrar);

        menuCategConsultar.setText("Consultar");
        menuCategConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCategConsultarActionPerformed(evt);
            }
        });
        menuCateg.add(menuCategConsultar);

        menuCategAlterar.setText("Alterar");
        menuCategAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCategAlterarActionPerformed(evt);
            }
        });
        menuCateg.add(menuCategAlterar);

        menuCategExcluir.setText("Excluir");
        menuCategExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCategExcluirActionPerformed(evt);
            }
        });
        menuCateg.add(menuCategExcluir);

        menuCategListar.setText("Listar");
        menuCategListar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCategListarActionPerformed(evt);
            }
        });
        menuCateg.add(menuCategListar);

        jMenuBar1.add(menuCateg);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(36, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    //Conecta com bd
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        GerenciadorConexao gc = GerenciadorConexaoImpl.getInstancia();
        try{
            gc.conectar();
            JOptionPane.showMessageDialog(null,"Iupiiiiiiii");
        }catch(ConexaoException e){
            JOptionPane.showMessageDialog(null, e.getMessage());
        }
       }//GEN-LAST:event_jButton1ActionPerformed

    private void menuClienteCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuClienteCadastrarActionPerformed
        TelaClienteCadastrar tcc = new TelaClienteCadastrar();
        tcc.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        tcc.setVisible(true);
    }//GEN-LAST:event_menuClienteCadastrarActionPerformed

    private void menuClienteConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuClienteConsultarActionPerformed
        TelaClienteConsultar telaClienteConsultar = new TelaClienteConsultar();
        telaClienteConsultar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaClienteConsultar.setVisible(true);
    }//GEN-LAST:event_menuClienteConsultarActionPerformed

    private void menuClienteAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuClienteAlterarActionPerformed
        TelaClienteAlterar telaClienteAlterar = new TelaClienteAlterar();
        telaClienteAlterar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaClienteAlterar.setVisible(true);
    }//GEN-LAST:event_menuClienteAlterarActionPerformed

    private void menuClienteExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuClienteExcluirActionPerformed
        TelaClienteExcluir telaClienteExcluir = new TelaClienteExcluir();
        telaClienteExcluir.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaClienteExcluir.setVisible(true);
    }//GEN-LAST:event_menuClienteExcluirActionPerformed

    private void menuClienteListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuClienteListarActionPerformed
        TelaClienteListar telaClienteListar = new TelaClienteListar();
        telaClienteListar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaClienteListar.setVisible(true);  
    }//GEN-LAST:event_menuClienteListarActionPerformed

    private void menuCategCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCategCadastrarActionPerformed
        TelaCategoriaCadastrar telaCategoriaCadastrar = new TelaCategoriaCadastrar();
        telaCategoriaCadastrar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaCategoriaCadastrar.setVisible(true);  
    }//GEN-LAST:event_menuCategCadastrarActionPerformed

    private void menuCategConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCategConsultarActionPerformed
        TelaCategoriaConsultar telaCategoriaConsultar = new TelaCategoriaConsultar();
        telaCategoriaConsultar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaCategoriaConsultar.setVisible(true);  
    }//GEN-LAST:event_menuCategConsultarActionPerformed

    private void menuCategAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCategAlterarActionPerformed
        TelaCategoriaAlterar telaCategoriaAlterar = new TelaCategoriaAlterar();
        telaCategoriaAlterar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaCategoriaAlterar.setVisible(true);
    }//GEN-LAST:event_menuCategAlterarActionPerformed

    private void menuCategExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCategExcluirActionPerformed
        TelaCategoriaExcluir telaCategoriaExcluir = new TelaCategoriaExcluir();
        telaCategoriaExcluir.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaCategoriaExcluir.setVisible(true);
    }//GEN-LAST:event_menuCategExcluirActionPerformed

    private void menuCategListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCategListarActionPerformed
        TelaCategoriaListar telaCategoriaListar = new TelaCategoriaListar();
        telaCategoriaListar.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        telaCategoriaListar.setVisible(true);
    }//GEN-LAST:event_menuCategListarActionPerformed

    private void menuFilmeCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFilmeCadastrarActionPerformed
        TelaFilmeCadastrar telaFilmeCadastrar = new TelaFilmeCadastrar();
        telaFilmeCadastrar.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        telaFilmeCadastrar.setVisible(true);
    }//GEN-LAST:event_menuFilmeCadastrarActionPerformed

    private void menuFilmeConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFilmeConsultarActionPerformed
        TelaFilmeConsultar telaFilmeConsultar = new TelaFilmeConsultar();
        telaFilmeConsultar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaFilmeConsultar.setVisible(true);
    }//GEN-LAST:event_menuFilmeConsultarActionPerformed

    private void menuFilmeAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFilmeAlterarActionPerformed
        TelaFilmeAlterar telaFilmeAlterar = new TelaFilmeAlterar();
        telaFilmeAlterar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaFilmeAlterar.setVisible(true);
    }//GEN-LAST:event_menuFilmeAlterarActionPerformed

    private void menuFilmeExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFilmeExcluirActionPerformed
        TelaFilmeExcluir telaFilmeExcluir = new TelaFilmeExcluir();
        telaFilmeExcluir.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaFilmeExcluir.setVisible(true);
    }//GEN-LAST:event_menuFilmeExcluirActionPerformed

    private void menuFilmeListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFilmeListarActionPerformed
        TelaFilmeListar telaFilmeListar = new TelaFilmeListar();
        telaFilmeListar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaFilmeListar.setVisible(true);
    }//GEN-LAST:event_menuFilmeListarActionPerformed

    private void menuLocCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLocCadastrarActionPerformed
        TelaLocCadastrar telaLocCadastrar = new TelaLocCadastrar();
        telaLocCadastrar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaLocCadastrar.setVisible(true);
    }//GEN-LAST:event_menuLocCadastrarActionPerformed

    private void menuLocListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLocListarActionPerformed
        TelaLocListar telaLocListar = new TelaLocListar();
        telaLocListar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaLocListar.setVisible(true);
    }//GEN-LAST:event_menuLocListarActionPerformed

    private void menuLocConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLocConsultarActionPerformed
        TelaLocConsultar telaLocConsultar = new TelaLocConsultar();
        telaLocConsultar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaLocConsultar.setVisible(true);
    }//GEN-LAST:event_menuLocConsultarActionPerformed

    private void menuLocAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLocAlterarActionPerformed
        TelaLocAlterar telaLocAlterar = new TelaLocAlterar();
        telaLocAlterar.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaLocAlterar.setVisible(true);
    }//GEN-LAST:event_menuLocAlterarActionPerformed

    private void menuLocExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLocExcluirActionPerformed
        TelaLocExcluir telaLocExcluir = new TelaLocExcluir();
        telaLocExcluir.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        telaLocExcluir.setVisible(true);
    }//GEN-LAST:event_menuLocExcluirActionPerformed
    
    
   
   
   
   
   
   
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(pooproj.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(pooproj.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(pooproj.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(pooproj.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new pooproj().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenu menuCateg;
    private javax.swing.JMenuItem menuCategAlterar;
    private javax.swing.JMenuItem menuCategCadastrar;
    private javax.swing.JMenuItem menuCategConsultar;
    private javax.swing.JMenuItem menuCategExcluir;
    private javax.swing.JMenuItem menuCategListar;
    private javax.swing.JMenuItem menuClienteAlterar;
    private javax.swing.JMenuItem menuClienteCadastrar;
    private javax.swing.JMenuItem menuClienteConsultar;
    private javax.swing.JMenuItem menuClienteExcluir;
    private javax.swing.JMenuItem menuClienteListar;
    private javax.swing.JMenuItem menuFilmeAlterar;
    private javax.swing.JMenuItem menuFilmeCadastrar;
    private javax.swing.JMenuItem menuFilmeConsultar;
    private javax.swing.JMenuItem menuFilmeExcluir;
    private javax.swing.JMenuItem menuFilmeListar;
    private javax.swing.JMenuItem menuLocAlterar;
    private javax.swing.JMenuItem menuLocCadastrar;
    private javax.swing.JMenuItem menuLocConsultar;
    private javax.swing.JMenuItem menuLocExcluir;
    private javax.swing.JMenuItem menuLocListar;
    // End of variables declaration//GEN-END:variables
}
